package net.lainiao.Service;

import net.lainiao.webservice.Admin;
import net.lainiao.webservice.AdminWebService;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.springframework.stereotype.Service;

/**
 * Created by Administrator on 2016/10/28.
 */
@Service
public class AdminService {
    public Admin getAdmin(long adminId){
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setServiceClass(AdminWebService.class);
        factory.setAddress("http://localhost:8080/soap/admin?wsdl");
        AdminWebService client = (AdminWebService) factory.create();
        Admin admin = client.getAdmin(adminId);
        return admin;
    }
}
